﻿
{if $this->session->flashdata('message')}
	<p>{$this->session->flashdata('message')}</p>
{/if}

<form action="{site_url('admin/aboutus/save')}" method="post">

	<span class="btn fileinput-button" onclick="">
    	<img src="{site_url('uploads/images/data/content')}/{$img}" alt="" style="padding: 5px 5px 5px 5px; background: none repeat scroll 0% 0% rgb(255, 255, 255); border: 1px solid rgb(228, 228, 228); float:left;" height="200px" width="270px" />
        <input class="fileupload" type="file" name="files0" data-url="aboutus/uploadImage/0" />
	</span>

	<div align="right">
        <textarea style="width: 100%; height: 200px;" name="text" id="id_description2" class="rte-zone">{$text}</textarea>
        <button style="margin-top: 10px;" type="submit" class="btn btn-primary accept" onclick="onAccept({$i})">
        	<span>Принимать</span>
        </button>
    </div>
</form>

<script src="{site_url('js/jquery-ui.min.js')}" type="text/javascript"></script>
<script src="{site_url('js/uploader/vendor/jquery.ui.widget.js')}"></script>
<script src="{site_url('js/uploader/jquery.iframe-transport.js')}"></script>
<script src="{site_url('js/uploader/jquery.fileupload.js')}"></script>
<script src="{site_url('js/imgbox/jquery.imgbox.pack.js')}" type="text/javascript"></script>
<script src="{site_url('js/jquery.contenthover.js')}"></script>

<script>

    var site_url = "{site_url()}";

    {if isset($error) && $error != ''}
        $('#errorMasseageDialog').html("{$error}");
        $('#errorMasseageDialog').dialog('open');
    {/if}
 
    {literal}

	jQuery(document).ready(function()
	{
        $("#errorMasseageDialog").dialog({
			autoOpen: false,
			modal: true,
			resizable: false,
			title: "Ошибка",
			buttons: {
					"OK": function(){
                       window.location.replace(site_url+"admin/aboutus");
				       $(this).dialog('close');
					}
				}
		});

        $('.fileupload').fileupload({
            dataType: 'json',
            done: function (e, data) {
                window.location.replace(site_url+"admin/aboutus");
            },
            error: function (data) {
                $("#errorMasseageDialog").empty().html(data.responseText);
				$("#errorMasseageDialog").dialog('open');
            }
        });
	});

</script>

{/literal}